package com.ruipeng.shengyapo.service;

import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * Created by tu_pei on 17/6/7.
 */
public interface OrderService {
    /**
     * 扫码生成订单
     * @param params
     * @return
     */
    int initAddRiDingOrder(Map<String, Object> params);

    /**
     * 获取用户未完成订单列表
     * @param params
     * @return
     */
    List<Map<String,Object>> getUserOrderByUserId(Map<String, Object> params);

    /**
     * 支付生成订单号
     */
    Map<String,Object> addOrderInfo(Map<String,Object> params);

    /**
     * 根据订单号查询订单
     * @return
     */
    Map<String,Object> getOrderByOrderNo(Map<String,Object> params);

    /**
     * 修改支付订单状态
     * @param orderNo
     * @return
     */
    int updateOrderByOrderNo(String orderNo,String orderInfo,int tradeStatus,String otherNo,String out_trade_no);

    /**
     * 微信回调成功，生成订单
     * @param params
     * @return
     */
    int addWxOrderInfo(Map<String,Object> params);

    /**
     * 获取用户充押金订单信息
     * @return
     */
    Map<String,Object> getUserOrderDeposit(int userId);

    /**
     * 退押金
     * @param userId
     * @return
     */
    boolean updateUserPayDeposit(HttpServletRequest request, HttpServletResponse response, int userId);

    /**
     *
     * @param ridingOrderId
     * @return
     */
    Map<String,Object> getUserRidingPaths(int ridingOrderId);
}
